package org.ecloud.oauth.server.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/** 
 * token时效，单位秒
 */
@Configuration
@ConfigurationProperties("token")
public class TokenConfig {
	
	/**
	 * acexpires:authorize_code时效
	 */
	private Integer acexpires;
	/**
	 * expires:access_token时效
	 */
	private Integer expires;
	/**
	 * remind:refresh_token时效
	 */
	private Integer remind;
	/**
	 * refreshTokenValidComplex:token续约是否进行二次校验
	 */
	private boolean refreshTokenValidComplex = false;
	/**
	 * 是否单端登录
	 */
	private Single authorizationCode = new Single();
	private Single password = new Single();
	private Single client = new Single();
	
	public Integer getAcexpires() {
		return acexpires;
	}
	public void setAcexpires(Integer acexpires) {
		this.acexpires = acexpires;
	}
	public Integer getExpires() {
		return expires;
	}
	public void setExpires(Integer expires) {
		this.expires = expires;
	}
	public Integer getRemind() {
		return remind;
	}
	public void setRemind(Integer remind) {
		this.remind = remind;
	}
	public boolean isRefreshTokenValidComplex() {
		return refreshTokenValidComplex;
	}
	public void setRefreshTokenValidComplex(boolean refreshTokenValidComplex) {
		this.refreshTokenValidComplex = refreshTokenValidComplex;
	}
	public Single getAuthorizationCode() {
		return authorizationCode;
	}
	public void setAuthorizationCode(Single authorizationCode) {
		this.authorizationCode = authorizationCode;
	}
	public Single getPassword() {
		return password;
	}
	public void setPassword(Single password) {
		this.password = password;
	}
	public Single getClient() {
		return client;
	}
	public void setClient(Single client) {
		this.client = client;
	}

	public static class Single {
		private boolean single = false;

		public boolean isSingle() {
			return single;
		}
		public void setSingle(boolean single) {
			this.single = single;
		}
	}
}
